//
//  YNNetworkManager.h
//  YNDemo
//
//  Created by 胡锦涛 on 2020/11/15.
//

#import <AFNetworking/AFNetworking.h>

NS_ASSUME_NONNULL_BEGIN

/** 请求成功的Block */
typedef void (^YNRequestSuccessBlock)(id _Nullable data);
/** 请求失败的Block */
typedef void (^YNRequestFailureBlock)(NSString * _Nullable error);
/** 请求进度的Block */
typedef void (^YNRequestProgressBlock)(NSProgress * _Nullable progress);

@interface HKNetworkManager : NSObject

/** 是否重复下载：仅用于下载使用 */
@property (nonatomic, assign) BOOL isRepeatedDownload ;

+ (instancetype)sharedInstance;

///发起一个Get请求
- (void)sendGetRequestWithUrl:(NSString *)url withParameters:(NSMutableDictionary *)parameters success:(YNRequestSuccessBlock)success failure:(YNRequestFailureBlock)failure;

///发起一个Post请求
- (void)sendPostRequestWithUrl:(NSString *)url withParameters:(NSMutableDictionary *)parameters success:(YNRequestSuccessBlock)success failure:(YNRequestFailureBlock)failure;

///发起一个下载请求
- (void)sendDownloadRequestWithUrl:(NSString *)url withParameters:(NSMutableDictionary *)parameters withProgress:(YNRequestProgressBlock)progressBlock success:(YNRequestSuccessBlock)success failure:(YNRequestFailureBlock)failure;

@end

NS_ASSUME_NONNULL_END
